From 37d690f32810e3ce57f5c8e351e9ac5854e9b96f Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 29 Jan 2007 21:16:02 +0000 Subject: [PATCH] Remove unused implementation of vsprintf(). Signed-off-by: Keir Fraser --- xen/common/vsprintf.c | 29 ----------------------------- xen/include/xen/lib.h | 3 +-- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index 3ed7b7052a..f4b788c403 100644 --- a/xen/common/vsprintf.c +++ b/xen/common/vsprintf.c @@ -182,15 +182,6 @@ static char *number( tmp[i++]='0'; else while (num != 0) tmp[i++] = digits[do_div(num,base)]; -#if 0 - else - { - /* XXX KAF: force unsigned mod and div. */ - unsigned long long num2=(unsigned long long)num; - unsigned int base2=(unsigned int)base; - while (num2 != 0) { tmp[i++] = digits[num2%base2]; num2 /= base2; } - } -#endif if (i > precision) precision = i; size -= precision; @@ -570,26 +561,6 @@ int scnprintf(char * buf, size_t size, const char *fmt, ...) } EXPORT_SYMBOL(scnprintf); -/** - * vsprintf - Format a string and place it in a buffer - * @buf: The buffer to place the result into - * @fmt: The format string to use - * @args: Arguments for the format string - * - * The function returns the number of characters written - * into @buf. Use vsnprintf or vscnprintf in order to avoid - * buffer overflows. - * - * Call this function if you are already dealing with a va_list. - * You probably want sprintf instead. - */ -int vsprintf(char *buf, const char *fmt, va_list args) -{ - return vsnprintf(buf, INT_MAX, fmt, args); -} - -EXPORT_SYMBOL(vsprintf); - /** * sprintf - Format a string and place it in a buffer * @buf: The buffer to place the result into diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 44ad7874cc..5eca2b08c6 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -62,8 +62,7 @@ extern int printk_ratelimit(void); /* vsprintf.c */ extern int sprintf(char * buf, const char * fmt, ...) __attribute__ ((format (printf, 2, 3))); -extern int vsprintf(char *buf, const char *, va_list) - __attribute__ ((format (printf, 2, 0))); +#define vsprintf __xen_has_no_vsprintf__ extern int snprintf(char * buf, size_t size, const char * fmt, ...) __attribute__ ((format (printf, 3, 4))); extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) -- 2.30.2